﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace mdk.Cenas
{
    class Credits
    {
        ContentManager content;
        Texture2D background;
        Texture2D back;
        Texture2D selected;
        SpriteFont font;
        SpriteFont help;

        List<String> people;
 

        public Credits(ContentManager content) 
        {
            this.content = content;
            background = content.Load<Texture2D>("img/Credit/mdk_credits");
            font = content.Load<SpriteFont>("font/MenuFont");
            back = content.Load<Texture2D>("img/Credit/voltar");
            selected = content.Load<Texture2D>("img/Credit/selected");
            help = content.Load<SpriteFont>("font/creditHelp");
            people = new List<String>();

            people.Add("Christian");
            people.Add("Felipe");
            people.Add("Germano");
            people.Add("Lucas");
            people.Add("Richard");
        }

        public void update(GameTime gameTime, KeyboardState currentKeyboard, KeyboardState lastKeyboard)
        {
            if (currentKeyboard.IsKeyDown(Keys.Enter) && !lastKeyboard.IsKeyDown(Keys.Enter))
            {
                Gerenciador.cena_atual = Gerenciador.Cena.MENU;
            }

        }

        public void draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(background, new Vector2(0, 0), Color.White);

            float y = 20;
            people.ForEach(delegate(String person) {
                spriteBatch.DrawString(font, person, new Vector2(50, y), Color.Tomato);
                y += 40;
            });

            spriteBatch.Draw(back, new Vector2(50, 450), Color.White);
            spriteBatch.Draw(selected, new Vector2(20, 455), Color.White);
            spriteBatch.DrawString(help, "Pressione Enter para sair", new Vector2(20, 490), Color.White);
        }

    }
}
